package com.everyline.baselibrary.activity;

import androidx.databinding.ViewDataBinding;

import com.everyline.baselibrary.base.BasePresenter;
import com.everyline.baselibrary.base.BaseView;

/**
 * crated by Administrator on 2021/6/3
 * 746608431@qq.com
 * 描述：TODO
 */
abstract public class BasePresenterActivity<V extends ViewDataBinding, T extends BasePresenter> extends BaseDBActivity<V> implements BaseView {
    protected T mPresenter;

    @Override
    protected void initPresenter() {
        if (mPresenter != null) {
            mPresenter.attachView(this);
        }

    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        if (mPresenter != null) {
            mPresenter.detachView();
        }
    }
}
